package reflect;

import java.lang.reflect.Proxy;

/**
 * @author wangyingjie
 * @date 2018年09月28日17:30:05
 * @remark 生成superPerson代理对象的工厂
 */
public class SuperPersonFactory {

    public static Object getProxy(){
        SuperPersonInvocationHandler invocationHandler = new SuperPersonInvocationHandler();
        invocationHandler.setTarget(new SuperPerson());
        return Proxy.newProxyInstance(ClassLoader.getSystemClassLoader(),new Class[]{Person.class},invocationHandler);
    }
}
